//
//  WSSNetTool.h
//  Cicada
//
//  Created by dllo on 16/5/11.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Reachability.h"

#import <UIKit/UIKit.h>

//get&post用枚举来展示数据类型
typedef NS_ENUM(NSUInteger, WSSResponseStyle) {
    WSSJSON,
    WSSDATA,
    WSSXML,
};

//POST里body类型的枚举
typedef NS_ENUM(NSUInteger, WSSRequestStyle) {
    WSSBodyJSON,
    WSSBodyString,
};

//重定义成功和失败的block
typedef void(^blockofSuccess)(id result);
typedef void(^blockofFailure)(NSError *error);

@interface WSSNetTool : NSObject

//对AFN再进行GET封装,方便自己使用
+ (void)GetNetByURL:(NSString *)urlString
               body:(id)body//GET的body体
            headers:(NSDictionary *)headers//请求头
           response:(WSSResponseStyle)response
            success:(blockofSuccess)success
            failure:(blockofFailure)failure;//想要返回的数据类型(枚举类型的JSON/DATA/XML)


//对AFN再进行POST封装,方便自己使用
+ (void)PostNetByURL:(NSString *)urlString
               body:(id)body//POST的body体
          bodyStyle:(WSSRequestStyle)bodyStyle//body类型(枚举值)
            headers:(NSDictionary *)headers//请求头
           response:(WSSResponseStyle)response
            success:(blockofSuccess)success
            failure:(blockofFailure)failure;//想要返回的数据类型(枚举类型的JSON/DATA/XML)


//有小菊花的get封装
+ (void)GetNet2ByURL:(NSString *)urlString
               body:(id)body//GET的body体
            headers:(NSDictionary *)headers//请求头
           response:(WSSResponseStyle)response
            success:(blockofSuccess)success
            failure:(blockofFailure)failure
           selfView:(UIView *)selfView;

@end
